package com.wss.module.main.ui.page;

import com.wss.common.base.BaseActionBarAbility;
import com.wss.common.base.mvp.BasePresenter;
import com.wss.common.utils.KeyboardUtils;
import com.wss.common.widget.MultipleItemView;
import com.wss.module.main.ResourceTable;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.ScrollView;
import ohos.agp.utils.Point;
import ohos.agp.utils.Rect;
import ohos.agp.window.service.Display;
import ohos.agp.window.service.DisplayManager;
import ohos.agp.window.service.Window;
import ohos.agp.window.service.WindowManager;
import ohos.eventhandler.EventHandler;
import ohos.eventhandler.EventRunner;

import java.util.Optional;

public class MultipleItemAbility extends BaseActionBarAbility {

    private MultipleItemView miv02;
    private MultipleItemView miv03;
    private MultipleItemView miv04;
    private MultipleItemView miv05;

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        Window window = getWindow();
        window.setInputPanelDisplayType(WindowManager.LayoutConfig.INPUT_ADJUST_PAN);
        initView();
    }

    @Override
    protected int getLayoutId() {
        return ResourceTable.Layout_ability_multiple_item;
    }

    @Override
    protected BasePresenter createPresenter() {
        return null;
    }

    private void initView() {
        setCenterText("多功能横向Item");
        findView();

        miv02.setRightTextSize(10);
        miv03.setLeftIconSize(50, 50);
        miv04.setLeftIconMargin(10, 0, 30, 0);
        miv05.setContentPadding(30);
    }

    private void findView() {
        miv02 = (MultipleItemView) findComponentById(ResourceTable.Id_miv_02);
        miv03 = (MultipleItemView) findComponentById(ResourceTable.Id_miv_03);
        miv04 = (MultipleItemView) findComponentById(ResourceTable.Id_miv_04);
        miv05 = (MultipleItemView) findComponentById(ResourceTable.Id_miv_05);

        ScrollView root = (ScrollView) findComponentById(ResourceTable.Id_multiple_item_scroll);
        new KeyboardUtils().adjustPan(root);
    }


}
